package com.hqq.helloworld;

import javax.inject.Inject;
import java.io.PrintStream;

/**
 * Package: com.hqq
 * User: 何芊芊
 * Email: heqianqian1@jd.com
 * Date: 2018/1/21
 * Time: 13:51
 * Description:控制台打印类
 */
public class PrintStreamWriter implements Destination {

    private PrintStream destination;

    @Inject
    public PrintStreamWriter(PrintStream destination) {
        this.destination = destination;
    }

    @Override
    public void write(String s) {
        destination.println(s);
    }
}
